﻿using KAKA.Domain;
using Morus;
using Morus.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KAKA.Repository
{
    public interface ITeamRepository : IRepository<Team>
    {
        void Destroy(Team team);
        Team Get(Guid id);

        IEnumerable<Team> GetAll();
    }

    public class TeamRepository : Repository<Team>, ITeamRepository
    {
        public TeamRepository(Database database)
            : base(database)
        {
        }

        public Team Get(Guid id)
        {
            return base.Get(Spec<Team>.Eval(r => r.Id == id));
        }

        public new void Destroy(Team team)
        {
            base.Destroy(team);
        }

        public new IEnumerable<Team> GetAll()
        {
            return base.GetAll();
        }
    }
}
